package src.ten;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class CityMap {

    public static Map<String,String[]> model = new LinkedHashMap<>();
    static {
        model.put("北京",new String[]{"北京"});
        model.put("上海",new String[]{"上海"});
        model.put("天津",new String[]{"天津"});
        model.put("重庆",new String[]{"重庆"});
        model.put("黑龙江",new String[]{"哈尔滨","齐齐哈尔","牡丹江","大庆","伊春","双鸭山","鹤岗","鸡西","佳木斯","七台河","黑河","大兴安岭"});
        model.put("吉林",new String[]{"长春","延边","吉林","白山","白域","四平","松原","辽源","大安","通化"});
        model.put("辽宁",new String[]{"沈阳","大连","葫芦岛","旅顺","本溪","抚顺","铁岭","辽阳","营口","朝阳","锦州","丹东","鞍山"});
    }

    public Object[] getProvince(){
        Map<String,String[]> map = CityMap.model;
        Set<String> set = map.keySet();
        Object[] province = set.toArray();
        return province;
    }

    public String[] getCity(String selectProvince){
        Map<String,String[]> map = CityMap.model;
        String[] arrCity = map.get(selectProvince);
        return arrCity;
    }
}
